import hxjson2.JSON;

/**
	* A simple function to inspect the JSON for items
	* before we build the chart
	*/
class JsonInspector
	{
	
	
	
	public static function has_pie_chart( json:Dynamic ): Bool
	{
		
		var elements:Array<Dynamic> = cast( json['elements'], Array);
		
		for( i in 0...elements.length)
		{
			// trace( elements[i]['type'] );
			
			if ( elements[i]['type'] == 'pie' )
				return true;
		}
		
		return false;
	}
	
	public static function is_radar( json:Dynamic ): Bool
	{
		
		if ( json['radar_axis'] != null )
			return true;
		
		return false;
	}
}
